-- GENERATED SPELL FOR [Rokmar the Crackler] --


function spell0_17991(pUnit, Event) --@Ensnaring Moss,n/a--
pUnit:FullCastSpellOnTarget(31948,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17991', 11000, 1)
end

function spell1_17991(pUnit, Event) --@Frenzy,Self--
pUnit:FullCastSpellOnTarget(34970,pUnit)
pUnit:RegisterEvent('Sorts_17991', 814, 1)
end

function spell2_17991(pUnit, Event) --@Grievous Wound,n/a--
pUnit:FullCastSpellOnTarget(31956,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17991', 0, 1)
end

function spell3_17991(pUnit, Event) --@Grievous Wound,n/a--
pUnit:FullCastSpellOnTarget(38801,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17991', 0, 1)
end

function spell4_17991(pUnit, Event) --@Water Spit,n/a--
pUnit:FullCastSpellOnTarget(35008,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17991', 1500, 1)
end

function Sorts_17991(pUnit, Event)
local choix_sorts_17991 = math.random(0, 4)
if choix_sorts_17991 == 0 then
pUnit:RegisterEvent('spell0_17991', 1, 1)
end
if choix_sorts_17991 == 1 then
pUnit:RegisterEvent('spell1_17991', 1, 1)
end
if choix_sorts_17991 == 2 then
pUnit:RegisterEvent('spell2_17991', 1, 1)
end
if choix_sorts_17991 == 3 then
pUnit:RegisterEvent('spell3_17991', 1, 1)
end
if choix_sorts_17991 == 4 then
pUnit:RegisterEvent('spell4_17991', 1, 1)
end
end

function mob17991_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17991', math.random(1500, 3000), 1)
end

function mob17991_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17991_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17991_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17991, 1, 'mob17991_Action')
RegisterUnitEvent(17991, 2, 'mob17991_Leave')
RegisterUnitEvent(17991, 3, 'mob17991_Kill')
RegisterUnitEvent(17991, 4, 'mob17991_Die')
